﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using GameJoltAPI;

namespace JoltSharp
{
    class Program
    {
        static TrophyClient tc;
        static UserClient uc;
        static SessionClient sc;

        static void Main(string[] args)
        {
            Console.WriteLine("Lets set things up, shall we?");
            Console.WriteLine("Please enter your Game Jolt Game ID (this is found on your Game Dashboard under Manage Achievements)");
            Settings.GameID = Console.ReadLine();
            Console.WriteLine("Please enter your Games Private Key (this is found on your Game Dashboard under Manage Achievements)");
            Settings.GameKey = Console.ReadLine();
            Console.WriteLine("Please enter your Game Jolt username");
            Settings.Username = Console.ReadLine();
            Console.WriteLine("Please enter your Game Jolt token");
            Settings.Token = Console.ReadLine();

            Console.WriteLine("Testing API as " + Settings.Username);

            tc = new TrophyClient();
            uc = new UserClient();
            sc = new SessionClient();
            sc.AutomaticallyPing = true;

            string input;
            do
            {
                Console.WriteLine("Please enter an Achievement ID that you want to unlock or nothing to stop");
                input = Console.ReadLine();
                if (!input.Trim().Equals(""))
                    tc.AchieveTrophy(input);
            } while ( !input.Trim().Equals(""));

            Console.Read();
        }

    }
}
